import SimpleXMLRPCServer
from osbase import BaseOsmpRPC
from daemonize import startstop



def main():
    obj = BaseOsmpRPC(['host',])
    #server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 22223))
    server = SimpleXMLRPCServer.SimpleXMLRPCServer(("0.0.0.0", 32223))
    server.register_multicall_functions()
    server.register_instance(obj, True)
    print "Listening on port 32223"
    server.serve_forever()




if __name__ == '__main__':
    startstop(stdout = "/tmp/oscl.out", pidfile = "/tmp/oscl.pid")
    main()
